from flask import Flask
from application.utils.unit import UnitReply
from application.database.write_neo4j import WirteNeo4j
from application.model_train_predict.rnn.rnn_train import TrainValid
app = Flask(__name__)


@app.route('/')
def hello_world():
    return True

@app.route("/index")
def index():
    #实例化对象
    trainVaild = TrainValid()
    trainVaild.model_train_valid()
    return "True"

@app.route('/neo4j')
def neo4j():
    neo4j = WirteNeo4j()
    data = neo4j.load_data()
    neo4j.write_to_neo4j(data)
    return ""

if __name__ == '__main__':
    app.run(host='0.0.0.0', port=8888, debug=True)
